#define paginate(currentPage, totalPage, ID, searchFunc, link)
#if(totalPage <= 0 || currentPage > totalPage) #return #end
#setLocal(startPage = currentPage - 4) #if (startPage < 1)
#setLocal(startPage = 1) #end #setLocal(endPage = currentPage + 4) #if
(endPage > totalPage) #setLocal(endPage = totalPage) #end

<ul class="pagination">
	#if (currentPage <= 8) #setLocal(startPage = 1) #end #if ((totalPage -
	currentPage) < 8) #setLocal(endPage = totalPage) #end #if (currentPage
	== 1)
	<li><span class="disabled prev_page">上页</span></li> #else
	<li><a
		href="#(link)#(searchFunc)/#(ID)-#(currentPage - 1)#(append)"
		class="prev_page">上页</a></li> #end #if (currentPage > 8)
	<li><a href="#(link)#(searchFunc)/#(ID)-#(1)#(append)">#(1)</a></li>
	<li><a href="#(link)#(searchFunc)/#(ID)-#(2)#(append)">#(2)</a></li>
	<li><span class="gap">…</span></li> #end #for(i : [startPage..endPage])
	#if (currentPage == i)
	<li><span class="current">#(i)</span></li> #else
	<li><a href="#(link)#(searchFunc)/#(ID)-#(i)#(append)">#(i)</a></li>
	#end #end #if ((totalPage - currentPage) >= 8)
	<li><span class="gap">…</span></li>
	<li><a href="#(link)#(searchFunc)/#(ID)-#(totalPage - 1)#(append)">#(totalPage
			- 1)</a></li>
	<li><a href="#(link)#(searchFunc)/#(ID)-#(totalPage)#(append)">#(totalPage)</a></li>
	#end #if (currentPage == totalPage)
	<li><span class="disabled next_page">下页</span></li> #else
	<li><a
		href="#(link)#(searchFunc)/#(ID)-#(currentPage + 1)#(append)"
		class="next_page" rel="next">下页</a></li> #end
</ul>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/js/bootstrap.min.js"></script>
#end
